package com.itheima.health.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("test")
public class TestController {
    @GetMapping("addData")
    @PreAuthorize("hasAnyAuthority('add')")
    public String add() {
        return "add--ok";
    }

    @GetMapping("updateData")
    @PreAuthorize("hasAnyAuthority('find')")

    public String update() {
        return "update--ok";
    }

    @GetMapping("delData")
    @PreAuthorize("hasAnyAuthority('del')")

    public String del() {
        return "del--ok";
    }

    @GetMapping("findData")
    @PreAuthorize("hasAnyAuthority('find')")

    public String find() {
        return "find--ok";
    }

}
